﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using HighLowTriple7;
using Library;
using Utils;

namespace WebTriple7.Class
{
    /// <summary>
    /// Summary description for AccountSession
    /// </summary>
    public class AccountSession
    {
        public AccountSession()
        {
            //
            // TODO: Add constructor logic here
            //
        }

        public static void Login(int id, string name, string fullName, int type, string displayName="")
        {
            UserUtils.AccountId = id;
            UserUtils.UserName = name;
            UserUtils.FullName = fullName;
            UserUtils.DisplayName = displayName;
            UserUtils.TypeAccount = type;
            UserUtils.IpAddress = Lib.GetAddressIp();
            UserUtils.Triple7AccessToken = Triple7.Instance(id, name, type);
        }

        public static void Logout()
        {
            UserUtils.AccountId = -1;
            UserUtils.UserName = string.Empty;
            UserUtils.FullName = string.Empty;
            UserUtils.TypeAccount = -1;
            UserUtils.Triple7AccessToken = string.Empty;
        }
    }
}